package com.wc.alorithm_luogu.P5719;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/19 16:40
 * @description https://www.luogu.com.cn/problem/P5719
 * 分类平均
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double n = sc.nextInt();
        double k = sc.nextInt();

        // 统计A类有多少个
        double ANum = 1;

        while (ANum * k <= n) {
            ANum++;
        }
        ANum--;

        // 计算A类的总的和
        double ASum = ANum * (ANum + 1) / 2 * k;
        // 计算B类的总的和
        double BSum = n * (n + 1) / 2 - ASum;

        double AAvg = ASum / ANum;

        double BAvg = BSum / (n - ANum);

        System.out.printf("%.1f %.1f", AAvg, BAvg);
    }
}
